<!DOCTYPE html>
<html lang="zh" xmlns:th="http://www.thymeleaf.org" >
<head>
    <th:block th:include="include :: header('修改加班')" />
    <th:block th:include="include :: datetimepicker-css" />
</head>
<body class="white-bg">
    <div class="wrapper wrapper-content animated fadeInRight ibox-content">
        <form class="form-horizontal m" id="form-work-edit" th:object="${sysOverWork}">
            <input name="overWorkId" th:field="*{overWorkId}" type="hidden">
            <div class="form-group">    
                <label class="col-sm-3 control-label">员工姓名：</label>
                <div class="col-sm-8">
                    <input name="userName" th:field="*{userName}" class="form-control" type="text">
                </div>
            </div>
            <div class="form-group">    
                <label class="col-sm-3 control-label">所属组织：</label>
                <div class="col-sm-8">
                    <input name="belongOrganization" th:field="*{belongOrganization}" class="form-control" type="text">
                </div>
            </div>
            <div class="form-group">    
                <label class="col-sm-3 control-label">职位：</label>
                <div class="col-sm-8">
                    <input name="post" th:field="*{post}" class="form-control" type="text">
                </div>
            </div>
            <div class="form-group">    
                <label class="col-sm-3 control-label">加班日期：</label>
                <div class="col-sm-8">
                    <div class="input-group date">
                        <input name="overWorkDate" th:value="${#dates.format(sysOverWork.overWorkDate, 'yyyy-MM-dd')}" class="form-control" placeholder="yyyy-MM-dd" type="text">
                        <span class="input-group-addon"><i class="fa fa-calendar"></i></span>
                    </div>
                </div>
            </div>
            <div class="form-group">    
                <label class="col-sm-3 control-label">加班类型：</label>
                <div class="col-sm-8">
                    <select name="overWorkType" class="form-control m-b" th:with="type=${@dict.getType('sys_over_work_type')}">
                        <option th:each="dict : ${type}" th:text="${dict.dictLabel}" th:value="${dict.dictValue}" th:field="*{overWorkType}"></option>
                    </select>
                </div>
            </div>
            <div class="form-group">    
                <label class="col-sm-3 control-label">申请日期：</label>
                <div class="col-sm-8">
                    <div class="input-group date">
                        <input name="applyDate" th:value="${#dates.format(sysOverWork.applyDate, 'yyyy-MM-dd')}" class="form-control" placeholder="yyyy-MM-dd" type="text">
                        <span class="input-group-addon"><i class="fa fa-calendar"></i></span>
                    </div>
                </div>
            </div>
            <div class="form-group">    
                <label class="col-sm-3 control-label">加班开始时间：</label>
                <div class="col-sm-8">
                    <div class="input-group date">
                        <input name="beginTime" th:value="${#dates.format(sysOverWork.beginTime, 'yyyy-MM-dd')}" class="form-control" placeholder="yyyy-MM-dd" type="text">
                        <span class="input-group-addon"><i class="fa fa-calendar"></i></span>
                    </div>
                </div>
            </div>
            <div class="form-group">    
                <label class="col-sm-3 control-label">加班结束时间：</label>
                <div class="col-sm-8">
                    <div class="input-group date">
                        <input name="endTime" th:value="${#dates.format(sysOverWork.endTime, 'yyyy-MM-dd')}" class="form-control" placeholder="yyyy-MM-dd" type="text">
                        <span class="input-group-addon"><i class="fa fa-calendar"></i></span>
                    </div>
                </div>
            </div>
            <div class="form-group">    
                <label class="col-sm-3 control-label">休息时长：</label>
                <div class="col-sm-8">
                    <input name="restTime" th:field="*{restTime}" class="form-control" type="text">
                </div>
            </div>
            <div class="form-group">    
                <label class="col-sm-3 control-label">加班小时数：</label>
                <div class="col-sm-8">
                    <input name="overWorkHour" th:field="*{overWorkHour}" class="form-control" type="text">
                </div>
            </div>
            <div class="form-group">    
                <label class="col-sm-3 control-label">加班原因：</label>
                <div class="col-sm-8">
                    <input name="overWorkReason" th:field="*{overWorkReason}" class="form-control" type="text">
                </div>
            </div>
            <div class="form-group">    
                <label class="col-sm-3 control-label">补偿方式：</label>
                <div class="col-sm-8">
                    <select name="rewardType" class="form-control m-b" th:with="type=${@dict.getType('sys_reward_type')}">
                        <option th:each="dict : ${type}" th:text="${dict.dictLabel}" th:value="${dict.dictValue}" th:field="*{rewardType}"></option>
                    </select>
                </div>
            </div>
            <div class="form-group">    
                <label class="col-sm-3 control-label">备注：</label>
                <div class="col-sm-8">
                    <input name="remarks" th:field="*{remarks}" class="form-control" type="text">
                </div>
            </div>
            <div class="form-group">    
                <!--<label class="col-sm-3 control-label is-required">员工编号：</label>-->
                <div class="col-sm-8">
                    <input name="userId" th:field="*{userId}" class="form-control" type="hidden" required>
                </div>
            </div>
            <div class="form-group">    
                <!--<label class="col-sm-3 control-label is-required">租户编号：</label>-->
                <div class="col-sm-8">
                    <input name="tenantId" th:field="*{tenantId}" class="form-control" type="hidden" required>
                </div>
            </div>
        </form>
    </div>
    <th:block th:include="include :: footer" />
    <th:block th:include="include :: datetimepicker-js" />
    <script th:inline="javascript">
        var prefix = ctx + "system/work";
        $("#form-work-edit").validate({
            focusCleanup: true
        });

        function submitHandler() {
            if ($.validate.form()) {
                $.operate.save(prefix + "/edit", $('#form-work-edit').serialize());
            }
        }

        $("input[name='overWorkDate']").datetimepicker({
            format: "yyyy-mm-dd",
            minView: "month",
            autoclose: true
        });

        $("input[name='applyDate']").datetimepicker({
            format: "yyyy-mm-dd",
            minView: "month",
            autoclose: true
        });

        $("input[name='beginTime']").datetimepicker({
            format: "yyyy-mm-dd hh:ii",
            minView: "month",
            autoclose: true
        });

        $("input[name='endTime']").datetimepicker({
            format: "yyyy-mm-dd hh:ii",
            minView: "month",
            autoclose: true
        });
    </script>
</body>
</html>